package com.kuang.demo.service;

import com.kuang.demo.bean.GoodsBean.GoodsVO.GoodsListVO;
import com.kuang.demo.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    GoodsMapper goodsMapper;
    @Override
    public GoodsListVO goodsList(GoodsListVO goodsListVO) {
        goodsListVO.setErrno(0);
        goodsListVO.setErrmsg("成功");
        GoodsListVO.DataBean dataBean = new GoodsListVO.DataBean();
        dataBean.setTotal(goodsMapper.selectGoodsTotalById());
        dataBean.setItems(goodsMapper.selectGoodsById());
        goodsListVO.setData(dataBean);
        return goodsListVO;
    }
}
